<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="ComplexTypes"
                  targetNamespace="http://kis.x-road.eu/"
                  xmlns="http://kis.x-road.eu/"
                  xmlns:mstns="http://kis.x-road.eu/"
                  xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
           xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
           >
<!--   <xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="file:///C:/arendus/XteeSolution/Src/Xtee.CodeDom.Test/bin/Debug/xsds/soapenc.xsd"></xs:import> -->
  <xs:include schemaLocation="file:///C:/arendus/XteeSolution/Src/Xtee.CodeDom.Test/Resources/SimpleTypes.xsd"></xs:include>
<xs:include schemaLocation="file:///C:/arendus/XteeSolution/Src/Xtee.CodeDom.Test/Resources/SimpleTypes/SimpleTypes.xsd"></xs:include>
<xs:include schemaLocation="file:///C:/arendus/XteeSolution/Src/Xtee.CodeDom.Test/Resources/SimpleTypes/ListTypes.xsd"></xs:include>
<xs:include schemaLocation="file:///C:/arendus/XteeSolution/Src/Xtee.CodeDom.Test/Resources/SimpleTypes/UnionTypes.xsd"></xs:include> 


 
   <xs:complexType name="RestrictedSimpleContentArray">
        <xs:sequence>
          <xs:element name="hoiatus" minOccurs="0" maxOccurs="unbounded">
            <xs:complexType>
              <xs:simpleContent>
                <xs:extension base="xs:string">
                  <xs:attribute name="grupp" type="xs:string" />
                  <xs:attribute name="kood" type="xs:string" />
                </xs:extension>
              </xs:simpleContent>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
   </xs:complexType>
                
  <xs:simpleType name="mountainbikesize">
    <xs:restriction base="xs:string">
      <xs:enumeration value="small"/>
      <xs:enumeration value="medium"/>
      <xs:enumeration value="large"/>
    </xs:restriction>
  </xs:simpleType>
  
   <xs:complexType name="FamilyMountainBikeSizes">
     <xs:simpleContent>
        <xs:extension base="mountainbikesize">
           <xs:attribute name="familyMember" type="xs:string" />
        </xs:extension>
     </xs:simpleContent>
  </xs:complexType>
  
  <xs:complexType name="RestrictedSimpleContent">
   <xs:simpleContent>
    <xs:restriction base="FamilyMountainBikeSizes" >
      <xs:enumeration value="small"/>
      <xs:enumeration value="medium"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>
  
  <xs:complexType name="ExtendedSimpleContent">
    <xs:simpleContent>
      <xs:extension base="xs:integer">
        <xs:attribute name="country" type="xs:string" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType> 

  <xs:complexType name="RR96ResponseV1">
        <xs:all>
          <xs:element name="Veakood" type="xs:integer"> 
          </xs:element>
          <xs:element name="Veatekst" type="xs:string"> 
             </xs:element>
          <xs:element name="Isikuandmed"> 
            <xs:complexType>
                  <xs:sequence>
                    <!-- jada milles on struktuurid (tabeli ridadest)-->
                    <xs:element name="item" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:all>
                          <xs:element name="Isikuandmed.Isikukood" type="xs:string"> 
                          </xs:element>
                          <xs:element name="Isikuandmed.Eesnimi" type="xs:string"> 
                          </xs:element>
                          <xs:element name="Isikuandmed.Meesnm" type="xs:string"> 
                          </xs:element> 
                        </xs:all> 
                      </xs:complexType>
                    </xs:element> 
                  </xs:sequence>
            </xs:complexType>
          </xs:element> 
        </xs:all>
      </xs:complexType>

   <xs:attribute name="referedUserDefinedAttribute" type="WorkDay"/> 
   <xs:complexType name="TypeWithAttributes">
<!-- 		<xs:sequence>
			<xs:element name="JustSomeElement" type="xs:string" />
		</xs:sequence> -->
		<xs:attribute name="builtInAttributeWithDefaultValue" type="xs:int" default="1"/>
		<xs:attribute name="builtinAttributeRequired" type="xs:int" use="required"/> 
		<xs:attribute name="builtInAttribute" type="xs:int"/>
		<xs:attribute name="userDefinedAttributeWithDefaultValue" type="WorkDay" default="Friday"/>
		<xs:attribute name="userDefinedAttribute" type="WorkDay"/> 
	    <xs:attribute ref="referedUserDefinedAttribute"/>
   </xs:complexType>
   
  <xs:complexType name="EemaldaToimingudParing">
        <xs:all>
          <xs:element name="toimingud" nillable="true">
            <xs:complexType>
                  <xs:sequence>
                    <xs:element name="item" nillable="true" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
                  </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="kasutaja" nillable="true" type="xs:string" />
        </xs:all>
   </xs:complexType>
  <xs:simpleType name="WorkDay">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Monday"></xs:enumeration>
      <xs:enumeration value="Tuesday"></xs:enumeration>
      <xs:enumeration value="Wednesday"></xs:enumeration>
      <xs:enumeration value="Thursday"></xs:enumeration>
      <xs:enumeration value="Friday"></xs:enumeration>
      <xs:enumeration value="Saturday"></xs:enumeration>
      <xs:enumeration value="Sunday"></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
        <xs:complexType name="VeelYksVeagaComplex">
        <xs:sequence>
          <xs:element name="PERNR" minOccurs="0">
            <xs:annotation>
              <xs:appinfo>
                PERNR
              </xs:appinfo>
            </xs:annotation>
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:maxLength value="8"/>
                <xs:pattern value="\d*"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="TYPE" minOccurs="0">
            <xs:annotation>
              <xs:appinfo>
                TYPE
              </xs:appinfo>
            </xs:annotation>
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:maxLength value="40"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="BEGDA" minOccurs="0" type="xs:date">
            <xs:annotation>
              <xs:appinfo>
                BEGDA
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
          <xs:element name="ENDDA" minOccurs="0" type="xs:date">
            <xs:annotation>
              <xs:appinfo>
                ENDDA
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
  
  <xs:simpleType name="Gender">
    <xs:restriction base="xs:string">
      <xs:enumeration value="M"></xs:enumeration>
      <xs:enumeration value="F"></xs:enumeration>
    </xs:restriction>
    
  </xs:simpleType>
  <xs:simpleType name="PositiveCelcius">
    <xs:restriction base="xs:int">
      <xs:maxInclusive value="200"></xs:maxInclusive>
      <xs:minInclusive value="0"></xs:minInclusive>
    </xs:restriction>
  </xs:simpleType>
  
              
  <xs:simpleType name="Role">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Executive"></xs:enumeration>
      <xs:enumeration value="ParkAttendant"></xs:enumeration>
      <xs:enumeration value="Programmer"></xs:enumeration>
      <xs:enumeration value="ProjectManager"></xs:enumeration>
    </xs:restriction>
    
  </xs:simpleType>
  <xs:complexType name="DoubleAnonymous">
    <xs:sequence>
      <xs:element name="Level1" minOccurs="0"> 
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Level2" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence> 
                  <xs:element name="Level3"> 
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="Level4" maxOccurs="unbounded">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element name="Level5" type="xs:string"/> 
                            </xs:sequence>
                          </xs:complexType> 
                        </xs:element>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>

      </xs:element>
    </xs:sequence>
  </xs:complexType>
      <xs:complexType name="RRExtSideDataResponse">
        <xs:sequence>
          <xs:element name="Isikud" minOccurs="0">

            <xs:complexType>
              <xs:sequence>
                <xs:element name="Isik" maxOccurs="unbounded">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="Isikukood" type="xs:string"/>
                      <xs:element name="Eesnimi" type="xs:string"/>
                      <xs:element name="Perenimi" type="xs:string"/>
                      <xs:element name="vead">

                        <xs:complexType>
                          <xs:sequence>
                            <xs:element name="viga" maxOccurs="unbounded">
                              <xs:complexType>
                                <xs:sequence>
                                  <xs:element name="kood" type="xs:string"/>
                                  <xs:element name="tekst" type="xs:string"/>
                                </xs:sequence>
                              </xs:complexType>

                            </xs:element>
                          </xs:sequence>
                        </xs:complexType>
                      </xs:element>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>

          </xs:element>
        </xs:sequence>
      </xs:complexType>
    <xs:complexType name="Registrikood">
    <xs:sequence>
      <xs:element minOccurs="0" name="Registrikood"   type="xs:int"> 
      </xs:element>  
    </xs:sequence>
  </xs:complexType>
  
  <xs:complexType name="sooritakanne_kandesisuv2">
    <xs:all>
      <xs:element minOccurs="0" name="registrikood"   type="xs:int">
        <xs:annotation>
          <xs:documentation>Täidetakse ainult muutmiskande korral</xs:documentation>
          <xs:appinfo>
            Registrikood
            Täidetakse ainult muutmiskande korral
          </xs:appinfo>
        </xs:annotation>
      </xs:element> 
      <xs:element minOccurs="0" name="pohitegevusala" type="Menetlus">
        <xs:annotation>
          <xs:appinfo>
            Põhitegevusala
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
      <xs:element minOccurs="0" name="lisategevusala" type="WorkDay">
        <xs:annotation>
          <xs:appinfo>
            Lisategevusala
          </xs:appinfo>
        </xs:annotation>
      </xs:element> 
    </xs:all>
  </xs:complexType>


  <xs:complexType name="ChoiceType">
        <xs:choice>
            <xs:element name="FirstChoice" type="xs:dateTime"/>
            <xs:element name="SecondChoice" type="Gender"/> 
            <xs:element name="ThirdChoice"  type="Employee"></xs:element>
             <xs:element name="FourthChoice" >
                <xs:complexType>
                      <xs:sequence>
                        <xs:element name="item" type="xs:dateTime" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
                      </xs:sequence>
                </xs:complexType>
              </xs:element>
           <xs:element name="FifthChoice" >
                <xs:complexType>
                      <xs:sequence>
                        <xs:element name="item" type="Gender" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
                      </xs:sequence>
                </xs:complexType>
              </xs:element>
                    <xs:element name="SixthChoice" >
                <xs:complexType>
                      <xs:sequence>
                        <xs:element name="item" type="Employee" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
                      </xs:sequence>
                </xs:complexType>
              </xs:element>
        </xs:choice>
    </xs:complexType>

  <xs:complexType name="SomeTypeMissing">
    <xs:sequence> 
      <xs:element name="vead">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="viga">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="kood" /> 
                  <xs:element name="tekst"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
    <xs:complexType name="ComplexTypeWithThreeBasicTypes">
    <xs:sequence> 
      <xs:element name="Builtin" type="xs:dateTime" ></xs:element> 
      <xs:element name="Udf"  type="Gender"></xs:element>
      <xs:element name="Complex"  type="Employee"></xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ComplexTypeWithThreeDifferentArrayTypes">
    <xs:sequence>

      <xs:element name="Builtins" nillable="true">
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" nillable="true" type="xs:dateTime" minOccurs="0" maxOccurs="unbounded" />
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="Udfs" nillable="true">
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" nillable="true" type="Gender" minOccurs="0" maxOccurs="unbounded" />
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="Complexs" nillable="true">
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" nillable="true" type="Employee" minOccurs="0" maxOccurs="unbounded" />
              </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType  name="Employee">
    <xs:sequence>
      <xs:element name="FirstName" type="xs:token"></xs:element>
      <xs:element name="LastName" type="xs:token"></xs:element>
      <xs:element name="Age" type="xs:int" ></xs:element>
      <!--1.Element tyyp on refereeritud simpleType-->
      <xs:element name="Genger" type="Gender"></xs:element>
      <!--2.Elemendi tyyp on deklareeritud simpletype -ina inline elemendi sees-->
      <xs:element name="BirthDate" >
        <xs:simpleType>
          <xs:restriction base="xs:dateTime">
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Salary" type="xs:decimal" >
        
      </xs:element>
      <!--3.Element tyyp on refereeritud complexType-->
      <xs:element name="Employer" type="Employee" nillable="true"> </xs:element>
      <!--4.Elemendi tyyp on deklareeritud complexType-ina inline elemendi sees-->
      <xs:element name="Department">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Country" type="xs:string"></xs:element>
            <xs:element name="Floor" type="xs:int"></xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <!--5.#simpletype referenced as array-->
      <xs:element name="DaysOff" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" type="WorkDay" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <!--6.#complextype referenced as array element-->
      <xs:element name="Subordinates"  minOccurs="0">
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" type="Employee" minOccurs="1" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
     
      <!--5.#simpletype declared inline  as array element-->
      <xs:element name="Roles"  nillable="1" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item"  minOccurs="0" maxOccurs="unbounded" nillable="true">
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="Executive"></xs:enumeration>
                      <xs:enumeration value="ParkAttendant"></xs:enumeration>
                      <xs:enumeration value="Programmer"></xs:enumeration>
                      <xs:enumeration value="ProjectManager"></xs:enumeration>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      
      <!--6.#complextype declared inline  as array element -->
      <xs:element name="ManagedRegions" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item"  minOccurs="0" maxOccurs="unbounded" nillable="true">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="Country" type="xs:string"></xs:element>
                      <xs:element name="City" type="xs:int"></xs:element>
                      <xs:element name="Street" type="xs:int"></xs:element>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="Abstract" abstract="1">
    <xs:sequence>
      <xs:element name="elem" type="xs:string"></xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="AbstractInherited" >
    <xs:complexContent >
      <xs:extension base="Abstract">
        <xs:sequence>
          <xs:element name="elem2" type="xs:string"></xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AbstractUsing" >
        <xs:sequence>
          <xs:element name="AbstractElem" type="Abstract"></xs:element>
          <xs:element name="AbstractElem2">
            <xs:complexType>
                  <xs:sequence>
                    <xs:element name="item" type="Abstract" minOccurs="1" maxOccurs="unbounded" nillable="true"/>
                  </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ConstructorTest">
    <xs:complexContent >
      <xs:extension base="ConstructorTestExtension">
        <xs:sequence>
          <xs:element name="CTProp" type="PositiveCelcius"           minOccurs="0"  maxOccurs="1"          nillable="0" ></xs:element>
          <xs:element name="CTProp1" type="PositiveCelcius"              minOccurs="0"  maxOccurs="1"          nillable="1" ></xs:element>
          <xs:element name="CTProp2" type="PositiveCelcius"           minOccurs="1"  maxOccurs="1"          nillable="0" ></xs:element>
          <xs:element name="CTProp3" type="PositiveCelcius"              minOccurs="1"  maxOccurs="1"          nillable="1" ></xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="ConstructorTestExtension">
    <xs:complexContent >
      <xs:extension base="XsdMinOccursMaxOccursComplexTypes">
        <xs:sequence>
          <xs:element name="CT2Prop" type="PositiveCelcius"           minOccurs="0"  maxOccurs="1"          nillable="0" ></xs:element>
          <xs:element name="CT2Prop1" type="PositiveCelcius"              minOccurs="0"  maxOccurs="1"          nillable="1" ></xs:element>
          <xs:element name="CT2Prop2" type="PositiveCelcius"           minOccurs="1"  maxOccurs="1"          nillable="0" ></xs:element>
          <xs:element name="CT2Prop3" type="PositiveCelcius"              minOccurs="1"  maxOccurs="1"          nillable="1" ></xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  
  <xs:complexType name="SequenceBuiltinNullables">
    <xs:annotation>
      <xs:appinfo>
        <![CDATA[Sequence]]>
      </xs:appinfo>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="XsdString" type="xs:string"></xs:element>
      <xs:element name="XsdDateTime" type="xs:dateTime"></xs:element>
      <!--DateTime-->
      <xs:element name="XsdDuration" type="xs:duration"></xs:element>
      <!--TimeSpan-->
      <xs:element name="XsdBoolean" type="xs:boolean"></xs:element>
      <!--bool-->
      <xs:element name="XsdUnsignedByte" type="xs:unsignedByte"></xs:element>
      <!--byte-->
      <xs:element name="XsdUnsignedShort" type="xs:unsignedByte"></xs:element>
      <!--short-->
      <xs:element name="XsdUnsignedInt" type="xs:unsignedShort"></xs:element>
      <!--uint-->
      <xs:element name="XsdUnsignedLong" type="xs:unsignedLong"></xs:element>
      <!--ulong-->
      <xs:element name="XsdByte" type="xs:byte"></xs:element>
      <!--sbyte-->
      <xs:element name="XsdShort" type="xs:short"></xs:element>
      <!--short-->
      <xs:element name="XsdInt" type="xs:int"></xs:element>
      <!--int-->
      <xs:element name="XsdLong" type="xs:long"></xs:element>
      <!--long-->
      <xs:element name="XsdDecimal" type="xs:decimal"></xs:element>
      <!--decimal-->
      <xs:element name="XsdFloat" type="xs:float"></xs:element>
      <!--float-->
      <xs:element name="XsdDouble" type="xs:double"></xs:element>
      <!--double-->
     
    </xs:sequence>
  </xs:complexType>
  
  <xs:complexType name="SequenceNullabilityOfBuiltInTypes">
    <xs:annotation>
      <xs:appinfo>
        <![CDATA[Sequence]]>
      </xs:appinfo>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="XsdStringNil" type="xs:string" nillable="true"></xs:element>
      <xs:element name="XsdStringNonNil" type="xs:string" nillable="false"></xs:element>
      <xs:element name="XsdDateTimeNil" type="xs:dateTime"  nillable="true" ></xs:element>
      <xs:element name="XsdDateTimeNonNil" type="xs:dateTime"  nillable="false" ></xs:element>
      <!--DateTime-->
      <xs:element name="XsdDurationNil" type="xs:duration"  nillable="true" ></xs:element>
      <xs:element name="XsdDurationNonNil" type="xs:duration"  nillable="false" ></xs:element>
      <!--TimeSpan-->
      <xs:element name="XsdBooleanNillable" type="xs:boolean"  nillable="true" ></xs:element>
      <xs:element name="XsdBooleanNonNillable" type="xs:boolean"  nillable="false" ></xs:element>
      
      <!--short-->
      <xs:element name="XsdUnsignedIntNillable" type="xs:unsignedShort"  nillable="true" ></xs:element>
      <xs:element name="XsdUnsignedIntNonNillable" type="xs:unsignedShort"  nillable="false" ></xs:element>

    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SequenceNullabilityOfUserDefined">
    <xs:annotation>
      <xs:appinfo>
        <![CDATA[Sequence]]>
      </xs:appinfo>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="DegreesNillable" type="PositiveCelcius"  nillable="true" ></xs:element>
      <xs:element name="DegreesNonNillable" type="PositiveCelcius"  nillable="false" ></xs:element>
      <!--1.Element tyyp on refereeritud simpleType-->
      <xs:element name="GengerNil" type="Gender" nillable="true"></xs:element>
      <xs:element name="GengerNonNil" type="Gender" nillable="false"></xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="XsdAll">
    <xs:all>
    
      <xs:element name="XsdStringNil" type="xs:string" nillable="true"></xs:element>
        <xs:element name="XsdStringMinOccurs0" type="Gender"  minOccurs="0"></xs:element>
      <xs:element name="XsdStringNonNil" type="xs:string" nillable="false"></xs:element>
      <xs:element name="XsdDateTimeNil" type="xs:dateTime"  nillable="true" ></xs:element>
      <xs:element name="XsdDateTimeNonNil" type="xs:dateTime"  nillable="false" ></xs:element>
      <xs:element name="XsdUnsignedIntNillable" type="xs:unsignedShort"  nillable="true" ></xs:element>
      <xs:element name="XsdUnsignedIntNonNillable" type="xs:unsignedShort"  nillable="false" ></xs:element>
      <xs:element name="DegreesNonNillable" type="PositiveCelcius"  nillable="false" ></xs:element>
      <!--1.Element tyyp on refereeritud simpleType-->
      <xs:element name="GengerNil" type="Gender" nillable="true"></xs:element>



    </xs:all>
  </xs:complexType>

  <xs:complexType name="XsdMinOccursMaxOccursComplexTypes">
    <xs:sequence>
      <xs:element name="A_Min1_Maz_Unbounded_Nil" type="Sequence"     minOccurs="1"  maxOccurs="unbounded"  nillable="1" ></xs:element>
      <xs:element name="A_Min1_Maz_Unbounded_NonNil" type="Sequence"  minOccurs="1"  maxOccurs="unbounded"  nillable="0" ></xs:element>
      <xs:element name="B_Min0_Maz_Unbounded_NonNil"  type="Sequence"          minOccurs="0"  maxOccurs="unbounded"  nillable="0"></xs:element>
      <xs:element name="B_Min0_Maz_Unbounded_Nil"  type="Sequence"             minOccurs="0"  maxOccurs="unbounded"  nillable="1"></xs:element>
      
      <xs:element name="C_Min0_Maz_1_Nil" type="Sequence"              minOccurs="0"  maxOccurs="1"  nillable="1" ></xs:element>
      <xs:element name="C_Min0_Maz_1_NonNil" type="Sequence"           minOccurs="0"  maxOccurs="1"  nillable="0" ></xs:element>
      <xs:element name="D_Min1_Maz_1_Nil"  type="Sequence"             minOccurs="1"  maxOccurs="1"  nillable="1"></xs:element>
      <xs:element name="D_Min1_Maz_1_NonNil"  type="Sequence"             minOccurs="1"  maxOccurs="1"  nillable="0"></xs:element>
    </xs:sequence>
  </xs:complexType>
  
  <xs:complexType name="XsdMinOccursMaxOccursUnbounded">
    <xs:sequence> 
      <xs:element name="BuiltIn_Min1_Maz_Unbounded_Nil" type="xs:dateTime"     minOccurs="1"  maxOccurs="unbounded"  nillable="1" ></xs:element>
      <xs:element name="BuiltIn_Min1_Maz_Unbounded_NonNil" type="xs:dateTime"  minOccurs="1"  maxOccurs="unbounded"  nillable="0" ></xs:element>
      <xs:element name="Udf_Min0_Maz_Unbounded_NonNil"  type="Gender"          minOccurs="0"  maxOccurs="unbounded"  nillable="0"></xs:element>
      <xs:element name="Udf_Min0_Maz_Unbounded_Nil"  type="Gender"             minOccurs="0"  maxOccurs="unbounded"  nillable="1"></xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="UnboundedElements">
    <xs:sequence> 
      <xs:element name="Second" type="xs:dateTime"  minOccurs="0"  maxOccurs="unbounded"  nillable="1" ></xs:element> 
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="XsdMinOccursMaxOccursUDFS">
    <xs:sequence>
      <xs:element name="Min0_Maz_1_NonNil" type="PositiveCelcius"           minOccurs="0"  maxOccurs="1"          nillable="0" ></xs:element>
      <xs:element name="Min0_Maz_1_Nil" type="PositiveCelcius"              minOccurs="0"  maxOccurs="1"          nillable="1" ></xs:element>
      <xs:element name="Min1_Maz_1_NonNil" type="PositiveCelcius"           minOccurs="1"  maxOccurs="1"          nillable="0" ></xs:element>
      <xs:element name="Min1_Maz_1_Nil" type="PositiveCelcius"              minOccurs="1"  maxOccurs="1"          nillable="1" ></xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="XsdMinOccursMaxOccursBuiltinTypes">
    <xs:sequence>
      <xs:element name="String_Min0_Maz_1_NonNil" type="xs:token"           minOccurs="0"  maxOccurs="1"          nillable="0" ></xs:element>
      <xs:element name="String_Min0_Maz_1_Nil" type="xs:token"              minOccurs="0"  maxOccurs="1"          nillable="1" ></xs:element>
      <xs:element name="String_Min1_Maz_1_NonNil" type="xs:token"           minOccurs="1"  maxOccurs="1"          nillable="0" ></xs:element>
      <xs:element name="String_Min1_Maz_1_Nil" type="xs:token"              minOccurs="1"  maxOccurs="1"          nillable="1" ></xs:element>
      
      <xs:element name="Min0_Maz_1_NonNil" type="xs:unsignedShort"          minOccurs="0"  maxOccurs="1"          nillable="0" ></xs:element>
      <xs:element name="Min0_Maz_1_Nil" type="xs:unsignedShort"             minOccurs="0"  maxOccurs="1"          nillable="1" ></xs:element>
      <xs:element name="Min1_Maz_1_NonNil" type="xs:unsignedShort"          minOccurs="1"  maxOccurs="1"          nillable="0" ></xs:element>
      <xs:element name="Min1_Maz_1_Nil" type="xs:unsignedShort"             minOccurs="1"  maxOccurs="1"          nillable="1" ></xs:element>
    </xs:sequence>
  </xs:complexType>
  
  
  <xs:complexType name="SequenceComplexElementSerialization">
    <xs:sequence>
      <xs:element name="EmployerNil" type="Employee" nillable="true"> </xs:element>
      <xs:element name="EmployerNonNil" type="Employee" nillable="false"> </xs:element>
    </xs:sequence>
  </xs:complexType>
 
     
    
   
   <xs:complexType name="BasicArray">
    <xs:sequence>
      <xs:element name="BuiltInReferenced2" nillable="false" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" type="xs:decimal" minOccurs="1" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SequenceArrayBuiltinReferenced">
    <xs:sequence>
      <xs:element name="BuiltInReferenced2" nillable="false" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemNillable" type="xs:decimal" minOccurs="1" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>      
    </xs:sequence>
  </xs:complexType>
  
  <xs:complexType name="SequenceArrayBuiltinReferenced2">
    <xs:sequence>
	<xs:element name="BuiltInReferenced3"  nillable="false" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemNonNillable" type="xs:decimal" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="BuiltInReferenced4" nillable="false" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemNillable" type="xs:decimal" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="SequenceArrayUserDefinedSTypeReferenced">
    <xs:sequence>
      <!--5.#simpletype referenced as array-->
      <xs:element name="SimpleTypeReferenced" nillable="false" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemNonNil" type="WorkDay" minOccurs="1" maxOccurs="unbounded" nillable="false"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="SimpleTypeReferenced2" nillable="false" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemNillable" type="WorkDay" minOccurs="1" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <!--5.#simpletype declared inline  as array element-->
      <xs:element name="SimpleTypeInline"   >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemNonNil"  minOccurs="1" maxOccurs="unbounded" nillable="false">
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="Executive"></xs:enumeration>
                      <xs:enumeration value="ParkAttendant"></xs:enumeration>
                      <xs:enumeration value="Programmer"></xs:enumeration>
                      <xs:enumeration value="ProjectManager"></xs:enumeration>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="SimpleTypeInline2" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemNil"  minOccurs="1" maxOccurs="unbounded" nillable="true">
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="Executive"></xs:enumeration>
                      <xs:enumeration value="ParkAttendant"></xs:enumeration>
                      <xs:enumeration value="Programmer"></xs:enumeration>
                      <xs:enumeration value="ProjectManager"></xs:enumeration>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
              </xs:sequence>
        </xs:complexType>
      </xs:element>

    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SequenceArrayItemMin0">
    <xs:sequence>
      <!--5.#simpletype referenced as array-->
      <xs:element name="NonNil_Min1_Max1" nillable="false" minOccurs="1" maxOccurs="1" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemNonNil" type="WorkDay" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>

      <!--5.#simpletype declared inline  as array element-->
      <xs:element name="Nil_Min1_Max1" nillable="true" minOccurs="1"  maxOccurs="1" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemNonNil"  minOccurs="0" maxOccurs="unbounded" nillable="false">
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="Executive"></xs:enumeration>
                      <xs:enumeration value="ParkAttendant"></xs:enumeration>
                      <xs:enumeration value="Programmer"></xs:enumeration>
                      <xs:enumeration value="ProjectManager"></xs:enumeration>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="NonNil_Min0_Max1" nillable="false" minOccurs="0"  maxOccurs="1" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" type="Employee" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="Nil_Min0_Max1" nillable="true" minOccurs="0"  maxOccurs="1" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" type="xs:decimal" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  
  <xs:complexType name="SequenceArrayComplexType">
    <xs:sequence>
       
      <!--6.#complextype referenced as array element-->
      <xs:element name="ComplexReferenced" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" type="Employee" minOccurs="1" maxOccurs="unbounded" nillable="false"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
      <!--6.#complextype declared inline  as array element -->
      <xs:element name="ComplexInline" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item"  minOccurs="1" maxOccurs="unbounded" nillable="true">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="Country" type="xs:string"></xs:element>
                      <xs:element name="City" type="xs:int"></xs:element>
                      <xs:element name="Street" type="xs:int"></xs:element>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
        </xs:complexType>
      </xs:element>

   
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="UsingSequenceArrayArray">
    <xs:sequence>
      <xs:element name="Levels" type="SequenceArrayArray"  minOccurs="1"  maxOccurs="1"></xs:element>
    </xs:sequence>    
  </xs:complexType>
  <xs:complexType name="SequenceArrayArray">
    <xs:sequence>
      <xs:element name="ArrayInline" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="itemFirstLevel"  minOccurs="0" maxOccurs="unbounded" nillable="true">
                  <xs:complexType>
                        <xs:sequence>
                          <xs:element name="itemSecondLevel"  minOccurs="0" maxOccurs="unbounded" nillable="true">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="Country" type="xs:string"></xs:element>
                                <xs:element name="City" type="xs:int"></xs:element>
                                <xs:element name="Street" type="xs:int"></xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>    
  </xs:complexType>
  
  <xs:complexType name="SequenceBuiltinNonNullables">
    <xs:annotation>
      <xs:appinfo>
        <![CDATA[Sequence]]>
      </xs:appinfo>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="XsdString" type="xs:string" nillable="false"></xs:element>
      <xs:element name="XsdDateTime" type="xs:dateTime"  nillable="false" ></xs:element>
      <!--DateTime-->
      <xs:element name="XsdDuration" type="xs:duration"  nillable="false" ></xs:element>
      <!--TimeSpan-->
      <xs:element name="XsdBoolean" type="xs:boolean"  nillable="false" ></xs:element>
      <!--bool-->
      <xs:element name="XsdUnsignedByte" type="xs:unsignedByte"  nillable="false" ></xs:element>
      <!--byte-->
      <xs:element name="XsdUnsignedShort" type="xs:unsignedByte"  nillable="false" ></xs:element>
      <!--short-->
      <xs:element name="XsdUnsignedInt" type="xs:unsignedShort"  nillable="false" ></xs:element>
      <!--uint-->
      <xs:element name="XsdUnsignedLong" type="xs:unsignedLong"  nillable="false" ></xs:element>
      <!--ulong-->
      <xs:element name="XsdByte" type="xs:byte"  nillable="false" ></xs:element>
      <!--sbyte-->
      <xs:element name="XsdShort" type="xs:short"  nillable="false" ></xs:element>
      <!--short-->
      <xs:element name="XsdInt" type="xs:int"  nillable="false" ></xs:element>
      <!--int-->
      <xs:element name="XsdLong" type="xs:long"  nillable="false" ></xs:element>
      <!--long-->
      <xs:element name="XsdDecimal" type="xs:decimal"  nillable="false" ></xs:element>
      <!--decimal-->
      <xs:element name="XsdFloat" type="xs:float"  nillable="false" ></xs:element>
      <!--float-->
      <xs:element name="XsdDouble" type="xs:double"  nillable="false" ></xs:element>
      <!--double-->

    </xs:sequence>
  </xs:complexType>
 
  
  <xs:complexType name="Sequence">
    <xs:annotation>
      <xs:appinfo>
        <![CDATA[Sequence]]>
      </xs:appinfo>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="SequenceElement" type="xs:string"></xs:element>
    </xs:sequence>
  </xs:complexType> 
  <xs:complexType name="All">
    <xs:annotation>
      <xs:appinfo>
        <![CDATA[All]]>
      </xs:appinfo>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="AllElement" type="xs:string" ></xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ContentModel">
    <xs:complexContent>
      <xs:extension base="Sequence">
        <xs:sequence>
         
          <xs:element name="ContentModelElement" type="xs:string"></xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="InlineSimpleType">
    <xs:sequence>
      <xs:element name="BirthDate" >
        <xs:simpleType>
          <xs:restriction base="xs:dateTime">
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="InlineComplexType">
    <xs:sequence>
      <xs:element name="Department">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Country" type="xs:string"></xs:element>
            <xs:element name="Floor" type="xs:int"></xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ReferencedSimpleTypeArray">
    <xs:sequence >
       <!--5.#simpletype referenced as array-->
      <xs:element name="DaysOff" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" type="WorkDay" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!--6.#complextype referenced as array element-->
  <xs:complexType name="ReferencedComplexTypeArray" >
    <xs:sequence>
      <xs:element name="Employees">
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" type="Employee" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
   
  </xs:complexType>

  <xs:complexType name="ReferencedBuiltInTypeArray">
    <xs:sequence>
      <xs:element name="Numbers" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item" type="xs:decimal" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
 
  <!--5.#simpletype declared inline  as array element-->
  <xs:complexType name="InlineSimpleTypeArray">
    <xs:sequence>
      <xs:element name="WorkTitles" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item"  minOccurs="0" maxOccurs="unbounded" nillable="true">
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="Executive"></xs:enumeration>
                      <xs:enumeration value="ParkAttendant"></xs:enumeration>
                      <xs:enumeration value="Programmer"></xs:enumeration>
                      <xs:enumeration value="ProjectManager"></xs:enumeration>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <!--6.#complextype declared inline  as array element -->
  <xs:complexType name="InlineComplexTypeArray">
    <xs:sequence>
      <xs:element name="ManagedRegions" >
        <xs:complexType>
              <xs:sequence>
                <xs:element name="item"  minOccurs="0" maxOccurs="unbounded" nillable="true">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="Country" type="xs:string"></xs:element>
                      <xs:element name="City" type="xs:int"></xs:element>
                      <xs:element name="Street" type="xs:int"></xs:element>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>    
  </xs:complexType>

  <xs:complexType name="ReferArrayOfDecimals">
    <xs:sequence>
      <xs:element name="ReferedArrayComplexType" type="ArrayOfDecimals"> </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ReferArrayOfAnonymousUserType">
    <xs:sequence>
      <xs:element name="ReferedArrayComplexType" type="ArrayOfAnonymousUserType"> </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!--if soap array with builtin types declared, then there is need for class to generate, 
  if type is used somewhere then this complex type is presented as generic list  -->
  <xs:complexType name="ArrayOfDecimals">
        <xs:sequence>
          <xs:element name="item" type="xs:decimal" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
        </xs:sequence>
  </xs:complexType>
  <!--But on the other hand , if soap array declared is holding anonymous content , then..
   .. of course , anonymous item type is generated as class , it is globally unique , because it resides on root level of scehma
    and complextype name can be used to name anonymous class ...-->
  <xs:complexType name="ArrayOfAnonymousUserType">
        <xs:sequence>
          <xs:element name="item"  minOccurs="0" maxOccurs="unbounded" nillable="true">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Country" type="xs:string"></xs:element>
                <xs:element name="City" type="xs:int"></xs:element>
                <xs:element name="Street" type="xs:int"></xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
  </xs:complexType>

  <xs:complexType name="Menetlus">
    <xs:sequence>
      <xs:element name="Osaline" type="Osaline" ></xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="Osaline">
    <xs:sequence>
      <xs:element name="Eesnimi" type="xs:string"></xs:element>
      <xs:element name="Perenimi" type="xs:string"></xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ToimingOsaline">
    <xs:complexContent>
      <xs:extension base="Osaline">
        <xs:sequence>
          <xs:element name="Liik" type="xs:int"></xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ComplexWithSoapEncBase64">
    <xs:sequence>
      <xs:element name="Sisu" type="xs:base64Binary" ></xs:element>
      <xs:element name="Sisu2" type="xs:base64Binary" ></xs:element>
    </xs:sequence>
  </xs:complexType>


</xs:schema>
